<style>
.mask{
	position: fixed;
	background:rgba(0,0,0,0.5);
	width: 100%;
	height: 100%;
	top: 0;
	text-align: center;
	z-index: 100;
	display: none;
}
.mask .code_box{
	position: absolute;
	margin-top:-10rem;
	top: 50%;
	left: 50%;
	margin-left: -7.5rem;
	width: 15rem;
	height: 20rem;
	background: #fff;
	border-radius:20px;
	line-height: 2.5rem;
	font-size: 0.7rem;
	color: #000;
	font-weight: bold;
}
.mask .code_box img{
	width: 10rem;
	height: 10rem;
}
.mask .code_box .img_box{
	line-height: 3;
	height:auto;
}
.mask .cav_code{
	width: 10rem;
	height: 1.8rem;
	line-height: 1.8rem;
	margin: auto;
	background: #f7f7f7;
	color: #6f6f6f;
}
.mask .error{
	font-size: 0.65rem;
	line-height: 1.2rem;
	font-weight: normal;
	color: #e85a6a;
	margin-top: 0.5rem;
}
</style>
<div class="order-list-page" ng-if="pagedata.op == 'list'">
    <div class="fui-header">
		<div class="fui-header-left" ng-click="goback()">
            <a class="back"></a>
        </div>
		<div class="title">我的预定</div>
		<div class="fui-header-right"></div>
	</div>
	<div style="margin-top:58px"></div>
	<div id="tab" class="fui-tab fui-tab-danger">
        <a ng-class="{'external active':pagedata.status == 100}" href="javascript:" ng-click="pagedata.status =100;tool.get_list('jy_qiuyuyue/server_order/list/status=100',true)">全部</a>
        <a ng-class="{'external active':pagedata.status == 0}" href="javascript:;" ng-click="pagedata.status =0;tool.get_list('jy_qiuyuyue/server_order/list/status=0',true)">待付款</a>
        <a ng-class="{'external active':pagedata.status == 1}" href="javascript:" ng-click="pagedata.status =1;tool.get_list('jy_qiuyuyue/server_order/list/status=1',true)">已付款</a>
        <a ng-class="{'external active':pagedata.status == 2}" href="javascript:" ng-click="pagedata.status =2;tool.get_list('jy_qiuyuyue/server_order/list/status=2',true)">已进场</a>
        <a ng-class="{'external active':pagedata.status == 4}" href="javascript:" ng-click="pagedata.status =4;tool.get_list('jy_qiuyuyue/server_order/list/status=4',true)">已完成</a>
		<a ng-class="{'external active':pagedata.status == 5}" href="javascript:" ng-click="pagedata.status =5;tool.get_list('jy_qiuyuyue/server_order/list/status=5',true)">已退款</a>
	</div>
	<div class='fui-content order-list' style="margin-top:4.5rem">
		<div class="fui-list-group order-item" ng-repeat="item in pagedata.list">
                <a ng-click="access_json('/server_order/detail/id='+item.id)" class="fui-list external" style="padding: 0.42rem 0.5rem" >
                    <div class="fui-list-inner">
                        <div class="subtitle"> 预订号: {{item.ordersn}}</div>
                    </div>
                    <div class="row-remark text-cancel" style="width: 4rem; font-size: 0.65rem;text-align: right;">{{item.statustitle}}</div>
					<div class="angle"></div>
                </a> 
                    <a ng-click="access_json('/server_order/detail/id='+item.id)" data-nocache="true">
                        <div class="fui-list-group-title lineblock">
                            <i class="icon jinyunicon icon-clock"></i> {{item.serve_title || '服务项目'}}
                            <span class="status noremark">场地：<span style="color:#f60;">{{item.plate.title || '默认场地'}}</span></span>
                        </div>
                    </a>
                    <a ng-click="access_json('/server_order/detail/id='+item.id)" class="external" data-nocache="true">
                        <div class="fui-list goods-list">
                            <div class="fui-list-media" style="">
                                <img class="" ng-src="{{tomedia(item.serve_image) || '../core/resource/images/nopic.jpg'}}">
                            </div>
                            <div class="fui-list-inner" style="height:auto">
                                <div class="text goodstitle towline">{{item.serve_title || '服务名称'}}</div>
								<div class="text">
								<div ng-repeat="row in item.serve_times" class="jy-2">
									<div class="yuyue-duan" style="width:auto;background:#f60;color:#fff;border: 1px solid #f60;">
										<div>{{item.day}} {{row.times.start}}--{{row.times.end}}</div>
										<div>(￥{{price(row.fee)}}) <span class="bold"> {{item.is_ban==1?'半场'+row.id:'全场'}}</span></div>
										<div class="clear"></div>
									</div>
								</div>
								</div>
								<div ng-if="item.users.length>0" class="col-jy" style="font-size:0.6rem">
									附加预约人：
									<div ng-repeat="row in item.users" class="label label-primary">
										{{row.name}}
									</div>
								</div>
							</div>
                            <div class="fui-list-angle">
                                ￥<span class="marketprice">{{item.pay}}</span></div>
                        </div>
                    </a>
					<div class="fui-list-group-title lineblock">
                            <i class="icon jinyunicon icon-dianpu"></i> {{item.store.title || '服务场馆'}}</br>
                            <i class="icon jinyunicon icon-map"></i> 场馆地址：<span style="color:#f60;">{{item.store.address || '无'}}</span>
                     </div>
                <div class="fui-list-group-title lineblock">
					<span style="color:#999;"><i class="icon jinyunicon icon-shijian" style="color:#f60;"></i> {{item.createtime}}</span>
                    <span ng-if="item.timesorderid==0" class="status noremark">共 <span>1</span> 个预定 实付: <span class="text-danger">￥{{item.pay}}</span></span>
					<span ng-if="item.timesorderid!=0" class="status noremark">共 <span>1</span> 个预定 <span class="text-danger"> 次卡消费</span></span>
                </div>
            <div class="fui-list-group-title lineblock opblock">
				<span class="status noremark">
					<div ng-show="item.status == 0" class="btn btn-sm btn-default-o order-delete" href="javascript:" ng-click="post({},'jy_qiuyuyue/server_order/del/','id='+item.id)">删除预定</div>
					<div ng-show="item.status == 0" class="btn btn-sm btn-danger-o order-finish" href="javascript:" ng-click="pagedata.pay(item.id)">支付预定</div>
					<div ng-show="item.can_refund" class="btn btn-sm btn-danger-o order-finish" href="javascript:;" ng-click="access_json('/refund/apply/orderid='+item.id)">申请退款</div>
					<div ng-show="item.status==4" class="btn btn-sm btn-danger-o order-finish" href="javascript:;" ng-click="access_json('/comment//id='+item.id)">评价</div>
					<div ng-show="item.status ==5 || item.status ==6" class="btn btn-sm btn-danger-o order-finish" href="javascript:;" ng-click="access_json('/refund/')">查看退款</div>
					<div ng-show="item.status == 1" class="btn btn-sm btn-danger-o order-finish" ng-click="pagedata.show_verify(item.ordersnurl,item.ordersn)" class="bold red">确认进场<i class="icon icon-erweima" style="color:#333"></i></div>
					<div ng-show="item.status == 2" class="btn btn-sm btn-danger-o order-finish" href="javascript:" ng-click="post({},'jy_qiuyuyue/server_order/receive/','id='+item.id)">确认完成</div>
				</span>
            </div>
        </div>
	</div>
	<div class="content-empty" ng-show="pagedata.list.length == 0 ">
		  <i class="icon jinyunicon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i><br/><p style="color: #999;font-size: .75rem">您暂时没有预定！</p>
	</div>
</div>
<div class="fui-page cav order_detail" ng-if="pagedata.op == 'detail'">
	<link rel="stylesheet" type="text/css" href="../addons/jy_weishop/custom/templates/mobile/css/orderdetail.css?v=2.3">
    <div class="fui-header">
		<div class="fui-header-left" ng-click="goback()">
            <a class="back"></a>
        </div>
		<div class="title">预定详情</div>
		<div class="fui-header-right"></div>
	</div>
	<div class='fui-content'>
		<div class="order_header" style="padding-top: .76rem; margin-bottom: -.266667rem;">
			  <div class="red" style="width:2.6rem;margin:0 auto">
				<i ng-if="pagedata.order.status == 4" class="icon icon-wrong" style="font-size:2.6rem"></i>
				<i ng-if="pagedata.order.status == 3" class="icon icon-success" style="font-size:2.6rem"></i>
				<i ng-if="pagedata.order.status == 2 || pagedata.order.status == 1" class="icon icon-clock" style="font-size:2.6rem"></i>
			  </div>
			  <div class="order_detail_ststus" style="padding:0.3rem;background:none">
					<div class="bold">
						<div style="font-size: 0.85rem;">{{pagedata.order.statustitle}}</div>
					</div>
					<div class="subtitle">{{pagedata.order.statusdesc}}</div>
					<div ng-click="pagedata.show_verify(pagedata.order.ordersnurl,pagedata.order.ordersn)" class="bold red">预定码：{{pagedata.order.ordersn}} <i class="icon icon-erweima" style="color:#333"></i></div>
			  </div>
		</div>
		<div class="weui_cells">
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>预定项目</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.post.serve_title">{{pagedata.serve.title}}</div>
			</div>
			<div ng-if="pagedata.order.plate.title" class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>预定场地</span>
					</div>
					<div class="weui_cell_ft" >{{pagedata.order.plate.title || '默认场地'}}</div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>预定人</span>
					</div>
					<div class="weui_cell_ft" >{{pagedata.order.username}}</div>
			</div>
			<div ng-if="pagedata.order.users.length>0" class="col-jy" style="font-size:0.6rem;padding:0.3rem 0.6rem">
						附加预约人：
						<div ng-repeat="row in pagedata.order.users" class="subtitle" style="font-size:0.6rem;">
								姓名:{{row.name}}，身份编号:{{row.code}}
						</div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>联系电话</span>
					</div>
					<div class="weui_cell_ft" >{{pagedata.order.mobile}}</div>
			</div>
			<div class="weui_cells_title" style="margin-top:0;padding-left:0.6rem">预定场次</div>
			<div class="weui_cell">
					<div ng-repeat="row in pagedata.order.serve_times" class="jy-2">
						<div class="yuyue-duan" style="width:auto;background:#f60;color:#fff;border: 1px solid #f60;">
							<div>{{pagedata.order.day}} {{row.times.start}}--{{row.times.end}}</div>
							<div>(￥{{price(row.fee)}})<span class="bold"> {{pagedata.order.is_ban!=1?'全场':'半场'}}</span></div>
							<div class="clear"></div>
						</div>
					</div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>备注</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.post.time">{{pagedata.order.remark}}</div>
			</div>
		<!--	<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>门店地址</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.post.address">{{pagedata.basic.address}}</div>
			</div>
			-->
			<div ng-if="pagedata.post.package_price>0" class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>服务费用</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.post.package_price">{{pagedata.order.package.package_price}}元</div>
			</div>
			<div ng-if="pagedata.order.pay>0" class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>实际支付 </span><span class="red"> ({{pagedata.order.paytype || '无'}})</span>
					</div>
					<div class="weui_cell_ft">{{pagedata.order.pay}}元</div>
			</div>
		</div>
	</div>
</div>
<div class="mask" ng-click="pagedata.close_verify()">
			<div class="code_box">
				<p>请将二维码出示给店员</p>
				<div class="img_box" id="show_verify_ewm">
					
				</div>
				<div class="cav_code" id="show_verify_code"></div>
				<div class="error">
					<p style="padding: 0 1.3rem">温馨提示：为了更好的保护您利益,请不要轻易将您的核销二维码泄露给他人</p>
				</div>
			</div>
</div>
<div ng-include="sys_html('_footer')"></div>
<script type="text/javascript">
scope.tool.get_list('jy_qiuyuyue/server_order/list/',true);
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_qiuyuyue/server_order/list/status='+scope.pagedata.status);
}
scope.pagedata.pay=function(id){
	scope.post_json('/server_order/pay/',{'id':id},function(pay_id){
		scope.$evalAsync();
		scope.tool.pay(pay_id,function(res){
				if(res.type=='success'){
					scope.message('支付成功！','success','jy_qiuyuyue/server_order/');
				}else{
					scope.message('支付失败！','success','jy_qiuyuyue/server_order/');
				}
		},'','','jy_qiuyuyue/server_order/','jy_qiuyuyue/server_order/');
	});

}
scope.pagedata.show_verify=function(url,code){
			scope.tool.qr(url,'show_verify_ewm',150)
			$('#show_verify_code').text(code);
			$('.mask').css({display:'block'});
}
$('.mask').click(function(){
			$(this).css({display:'none'})
})
</script>